<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<isperp:grid url="change/change/listStatusProcessDetail" gridId="changeGrid"
	processKey="changeProcess" sortname="code" sortorder="desc"
	ondbClickRowEvent="changeGrid.edit(rowid);"
	cusViewUrl="change/change/view"
	excelExportUrl="change/change/excelExport">

	<jsp:attribute name="toolbar">
	<isperp:treeMenu id="changeMenu" targetGridId="changeGrid">
		<isperp:async enable="true" url="change/change/statusProcessMenu"></isperp:async>
		<isperp:callback onClick="changeMenuTree_onNodeClick"
				onAsyncSuccess="changeMenuTree_onNodeClickFirst();">
		</isperp:callback>
	</isperp:treeMenu>
	<isperp:toolbar id="userToolbar">
		
	</isperp:toolbar>
	</jsp:attribute>

	<jsp:attribute name="searchbar">
	<table class="search-table">
		<tbody>
			<tr>
				<td class="td1">编号：</td>
				<td class="td2"><input type="text" field="code" op="cn">
					</td>
				<td class="td1">标题：</td>
				<td class="td2"><input type="text" field="title" op="cn">
					</td>
				<td class="td1">分类：</td>
				<td class="td2"><input type="text" field="changeType" op="cn">
				</td>
			</tr>
			<tr>
				<td class="td1">请求人：</td>
				<td class="td2"><input type="text" field="requesterName"
						op="cn">
					</td>
				<td class="td1">登记时间：</td>
				<td class="td2" colspan="3"><input id="createDateStart"
						type="date" field="create_date" op="gt" style="width: 68px" />~<input
						id="createDateEnd" type="date" field="create_date" op="lt"
						style="width: 68px" />
					</td>
			</tr>
		</tbody>
	</table>
	</jsp:attribute>
	<jsp:body>
	<isperp:column name="id" title="" hidden="true"></isperp:column>
	<isperp:column name="sla_status" title="" hidden="true"></isperp:column>
	<isperp:column name="priority_name" title="" width="40"
			isFormatterFun="true" formatter="return statusFormatter(rowObject);">
	</isperp:column> 
	<isperp:column name="code" title="编号" width="100">
	</isperp:column>
	<isperp:column name="title" title="标题" width="120">
	</isperp:column>
	<isperp:column name="change_type" title="变更类型" width="120">
	</isperp:column>
	<isperp:column name="requester_name" title="请求人" width="80">
	</isperp:column>
	<isperp:column name="create_date" title="登记时间" width="100">
	</isperp:column>
	<isperp:column name="status" title="状态" width="80">
	</isperp:column>
	</jsp:body>
</isperp:grid>

<isperp:operate code="CHG_HANDLE"></isperp:operate>

<script type="text/javascript">
	function statusFormatter(rowObject) {
		var p = 5;
		switch (rowObject.priority_name) {
		case "一级":
			p = 1;
			break;
		case "二级":
			p = 2;
			break;
		case "三级":
			p = 3;
			break;
		case "四级":
			p = 4;
			break;
		case "五级":
			p = 5;
			break;
		}
		html = "<img title='优先级："+p+"级' src='img/incident/p"+p+".png'>";
		if (rowObject.sla_status == 1) {

			html = html + "&nbsp;<img title='SLA：异常'  src='img/incident/sla_unusual.png'>";
		}
		return html;
	}
</script>
